<?php

class Application_Form_Inscription extends Zend_Form
{
	public function init()
	{
		$this->setName("Inscription");
			
		$login = new Zend_Form_Element_Text("LoginU");
		//$login->setLabel("Login :");
		$login->setAttrib("class", "inp-form");
		
		
		$password = new Zend_Form_Element_Password("PasswordU");
		//$password->setLabel("Password");
		$password->setAttrib("class", "inp-form");
		
		$verifPassword = new Zend_Form_Element_Password("VerifPasswordU");
		//$verifPassword->setLabel("Verification Password");
		$verifPassword->setAttrib("class", "inp-form");
		
		$fname = new Zend_Form_Element_Text("NomU");
		//$fname->setLabel("Nom :");
		$fname->setAttrib("class", "inp-form");
		
		$lname = new Zend_Form_Element_Text("PrenomU");
		//$lname->setLabel("Prenom :");
		$lname->setAttrib("class", "inp-form");
		
		$email=new Zend_Form_Element_Text("EmailU");
		//$email->setLabel("Email :");
		$email->setAttrib("class", "inp-form");
		
		$role = new Zend_Form_Element_Select("RoleU");
		//$role->setLabel("Groupe : ");
		$role->setAttrib("class", "styledselect_form_1");
		$role->addMultiOption("Admin","Administrateur");
		$role->addMultiOption("Manager","Manager");
		$role->addMultiOption("Collaborateur","Collaborateur");
		$role->addMultiOption("Responsable","Responsable");
		
		$responsable = new Zend_Form_Element_Select("ResponsableU");
		$responsable->setAttrib("class", "styledselect_form_1");
		$responsable->setRequired(true);
		$table = new Application_Model_DbTable_Utilisateur();
		
		foreach ( $table->getUsers() as $c)
		{
			$responsable->addMultiOption($c->id, $c->lname);
		}
		//$responsable->setValue($users['login']);
				
		$incriptionButton = new Zend_Form_Element_Submit("incriptionButton");
		//$incriptionButton->setLabel("S'incrire");
		$incriptionButton->setAttrib("class", "form-submit");
		
		$annulerButton = new Zend_Form_Element_Button("annulerInscriButton");
		$annulerButton->setAttrib("onClick", "window.location='acceuil'");

		$resetButton = new Zend_Form_Element_Reset("resetButton");
		//$resetButton->setLabel("Effacer");
		$annulerButton->setAttrib("class", "form-reset");
		
		$this->addElements(array($login,$password,$verifPassword,$fname,$lname,$email,$role
		,$responsable,$incriptionButton,$annulerButton,$resetButton));
	}
}